package org.terramagnet.pdmviewer.parser;

import java.util.LinkedHashMap;
import java.util.Map;

public class PDMReference extends PDMObject{

    private String id;
    private String name;
    private String code;
    private String constraintName;
    private String parentTable;
    private String childTable;
    private int updateConstraint = 1;
    private int deleteConstraint = 1;
    private String implementationType;
    private final Map<String, PDMReferenceJoin> joins = new LinkedHashMap<>();

    /**
     * @return the id
     */
	@Override
    public String getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the code
     */
    public String getCode() {
        return code;
    }

    /**
     * @param code the code to set
     */
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * @return the constraintName
     */
    public String getConstraintName() {
        return constraintName;
    }

    /**
     * @param constraintName the constraintName to set
     */
    public void setConstraintName(String constraintName) {
        this.constraintName = constraintName;
    }

    /**
     * @return the parentTable
     */
    public String getParentTable() {
        return parentTable;
    }

    /**
     * @param parentTable the parentTable to set
     */
    public void setParentTable(String parentTable) {
        this.parentTable = parentTable;
    }

    /**
     * @return the childTable
     */
    public String getChildTable() {
        return childTable;
    }

    /**
     * @param childTable the childTable to set
     */
    public void setChildTable(String childTable) {
        this.childTable = childTable;
    }

    /**
     * @return the updateConstraint
     */
    public int getUpdateConstraint() {
        return updateConstraint;
    }

    /**
     * @param updateConstraint the updateConstraint to set
     */
    public void setUpdateConstraint(int updateConstraint) {
        this.updateConstraint = updateConstraint;
    }

    /**
     * @return the deleteConstraint
     */
    public int getDeleteConstraint() {
        return deleteConstraint;
    }

    /**
     * @param deleteConstraint the deleteConstraint to set
     */
    public void setDeleteConstraint(int deleteConstraint) {
        this.deleteConstraint = deleteConstraint;
    }

    /**
     * @return the implementationType
     */
    public String getImplementationType() {
        return implementationType;
    }

    /**
     * @param implementationType the implementationType to set
     */
    public void setImplementationType(String implementationType) {
        this.implementationType = implementationType;
    }

    /**
     * @return the joins
     */
    public Map<String, PDMReferenceJoin> getJoins() {
        return joins;
    }

    @Override
    public String toString() {
        return "PDMReference{" + "id=" + id + ", name=" + name + ", code=" + code + ", constraintName=" + constraintName + ", parentTable=" + parentTable + ", childTable=" + childTable + ", updateConstraint=" + updateConstraint + ", deleteConstraint=" + deleteConstraint + ", implementationType=" + implementationType + ", joins=" + joins + '}';
    }

}
